package main

import "fmt"

func main(){
	fmt.Println(findStr( "bcd", "abbbbcde"))
}

func findStr(pat, txt string) int {
	for j := 0; j< len(txt) - len(pat); j++{
		for i := 0; i < len(pat); i ++ {
			if pat[i] != txt[j+i] {
				break
			} else if i == len(pat) -1 {
					return j
			}
		}
	}
	return -1
}

func kmp(pat, txt string) int {
	next := make([]map[int]int, len(pat))
	for i := 1; i < len(next);i++{

	}


	for i := 0; i < len(pat); i++{
		for j:= 0; j<26;j++{
			if pat[i] -  == j{

			}
		}
		ch := pat[i] - 'a'
		next[i][ch] = next[i]
	}
}